package com.nervenets.web.hibernate.domain.news;

import com.nervenets.web.enumeration.NewsType;
import com.nervenets.web.hibernate.DomainObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;

import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "news")
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class News extends DomainObject {
    private long userId;
    private NewsType type = NewsType.normal;
    @Type(type = "com.nervenets.web.adapter.jsonType.NewsInfoJson")
    private NewsInfo info = new NewsInfo();
    private boolean hot;
    private int queue;
}
